const user = {
    index: true,
    border: true,
    stripe: true,
    menuAlign: 'center',
    loadingText: "加载中...",
    loadingSpinner: "svg",
    loadingSvgViewBox: "-10, -10, 50, 50",
    loadingBackground: "rgba(122, 122, 122, 0.6)",
    labelWidth: 120,
    menu: true,
    menuWidth: 270,
    addBtn: false,
    delBtn: false,
    editBtn: false,
    column: [
        {
            label: "用户ID",
            prop: "userId",
            minWidth: 120,
            display: false,
            search: true
        },
        {
            label: '用户名',
            prop: 'name',
            minWidth: 120,
            display: false,
            search: true,
            overHidden: true
        },
        {
            label: '上级',
            prop: 'promoter',
            minWidth: 80,
            display: false,
            search: true,
        },
        {
            label: '密码',
            prop: 'pass',
            minWidth: 150,
            display: false,
            search: true,
        },
        {
            label: '是否标记',
            prop: 'status',
            minWidth: 120,
            display: false,
            search: true,
            searchType: "select",
            dicData: [
                {
                    label: '未标记',
                    value: 0
                },
                {
                    label: '已标记',
                    value: 1
                },
            ]
        },
        {
            label: '是否控制',
            prop: 'control',
            minWidth: 130,
            search: true,
            searchType: "select",
            hide: true,
            dicData: [
                {
                    label: '未控制',
                    value: 0
                },
                {
                    label: '送分',
                    value: 1
                },
                {
                    label: '杀分',
                    value: 2
                },
            ]
        },
        {
            label: '电话',
            prop: 'mobile',
            minWidth: 130,
            display: false,
            search: true
        },
        {
            label: '可提余额',
            prop: 'gold',
            minWidth: 120,
            display: false,
            formatter: (row, value, column) => {
                return row.gold
                    ? row.gold > row.bindGold
                        ? (row.bindGold / 100).toFixed(2)
                        : (row.gold / 100).toFixed(2)
                    : "0.00"

            }
        },
        {
            label: '冻结余额',
            minWidth: 120,
            display: false,
            formatter: (row, value, column) => {
                return row.bindGold
                    ? ((row.bindGold - row.gold) / 100).toFixed(2) > 0
                        ? ((row.bindGold - row.gold) / 100).toFixed(2)
                        : "0.00"
                    : "0.00"
            }
        },
        {
            label: '积分',
            prop: 'point',
            minWidth: 120,
            display: false,

        },
        {
            label: '签到天数',
            prop: 'signTimes',
            minWidth: 120,
            display: false,
        },

        {
            label: '充值次数',
            prop: 'rechargeTimes',
            minWidth: 120,
            display: false,
        },
        {
            label: '提现次数',
            prop: 'withdrawTimes',
            minWidth: 120,
            display: false,
        },
        {
            label: '设备号',
            prop: 'mac',
            minWidth: 120,
            display: false,
            overHidden: true
        },
        {
            label: '注册IP',
            prop: 'registerIp',
            minWidth: 150,
            display: false,
            search: true
        },
        {
            label: '最近登录IP',
            prop: 'loginIp',
            minWidth: 150,
            display: false,
            search: true
        },
        {
            label: '注册时间',
            prop: 'registerTime',
            minWidth: 180,
            display: false,
            type: 'datetime',
            search: true,
            searchSpan: 18,
            searchRange: true,
            formatter: (row, value, column) => {
                return formatDate(row.registerTime * 1000, '-')
            }
        },
        {
            label: '最近登录时间',
            prop: 'loginTime',
            minWidth: 180,
            display: false,
            formatter: (row, value, column) => {
                return formatDate(row.loginTime * 1000, '-')
            }
        },
        {
            label: '是否充值',
            prop: 'isrecharge',
            minWidth: 120,
            display: false,
            search: true,
            searchType: "select",
            hide: true,
            dicData: [{ label: '已充值', value: 1 }, { label: '未充值', value: 2 }]
        },
    ],
}

const formatDate = (date, cut) => {
    var date = new Date(date);
    var YY = date.getFullYear() + cut;
    var MM =
        (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + cut;
    var DD = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
    var hh = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
    var mm = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
    var ss = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
    return YY + MM + DD + " " + hh + mm + ss;
};

export default user